package com.ux.example
{
	import com.greensock.TweenMax;
	import com.greensock.data.ColorMatrixFilterVars;
	import com.greensock.data.TweenMaxVars;
	import com.ux.base.BLoader;
	import com.ux.manager.StageManager;
	import com.ux.util.BitmapUtil;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.MouseEvent;
	
	public class BrightenTest extends Sprite
	{
		
		private var mc0 : MovieClip;
		private var mc1 : MovieClip;
		private var loader : BLoader;
		
		public function BrightenTest()
		{
			super();
			StageManager.stage = stage;
			
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			mc0 = new MovieClip();
			
			addChild( mc0 );
			
			loader = new BLoader( "../assets/test.jpg", mc0 );
//			mc0.addChild( BitmapUtil.MakeBitmap( 400, 400, 0x000000 ) );
			
			
			stage.addEventListener( MouseEvent.CLICK, onClick );
			
		}
		
		
		private function onClick( e:MouseEvent ):void
		{
			mc0.alpha = 0;
			
			var tweenColor : ColorMatrixFilterVars = new ColorMatrixFilterVars(0xffffff,1,1,1,5);
			TweenMax.to( mc0, 0, {colorMatrixFilter : tweenColor} );
			
			tweenColor = new ColorMatrixFilterVars( 0xffffff, 0 );
			
			var tween : TweenMaxVars = new TweenMaxVars();
			tween.colorMatrixFilter( 0xffffff, 0 );
			tween["alpha"] = 1;
			
			TweenMax.to( mc0, 1, tween );
		}
	}
}



